using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter21
{
	/// <summary>
	/// Example04: Thermal Excitation of Atomic Energy Levels
	/// As we discussed in Section 21.4, atoms can occupy only
	/// certain discrete energy levels. Consider a gas at a
	/// temperature of 2500 K whose atoms can occupy only two
	/// energy levels seperated by 1.5 eV, where 1 eV is an 
	/// energy unit equal to 1.6 \times 10^{-19} J. Determine the
	/// ratio of the number of atoms in the higher energy
	/// level to the number in the lower energy level.
	/// n(E_2)/n(E_1) = 9.64 \times 10^{-4}
	/// </summary>
	public class Example04
	{
		public Example04()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Temperature T = new L.Temperature();
			T.K = 2500.0;
			L.Energy Ei = new L.Energy();
			Ei.J = 0.0;
			L.Energy Ef = new L.Energy();
			Ef.J = 1.5*1.6E-19;
			double ratio = L.FundamentalLaw.BoltzmannDistribution(Ef,T)
				/L.FundamentalLaw.BoltzmannDistribution(Ei,T);
			result+=Convert.ToString(ratio)+"\r\n";
		}
	}
}
